package com.example.zk.adapter

import android.widget.CheckBox
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.CarEntity
import com.example.base.entity.CarInfo
import com.example.zk.R

class CarAdapter:BaseQuickAdapter<CarInfo,BaseViewHolder>(R.layout.item_car) {
    override fun convert(holder: BaseViewHolder, item: CarInfo) {
        holder.getView<CheckBox>(R.id.car_cb).isChecked = item.isChecked
        Glide.with(context).load(item.image).into(holder.getView(R.id.car_image))
        holder.setText(R.id.car_name,item.storeName)
        holder.setText(R.id.car_price,"￥${item.price}")
        holder.setText(R.id.car_num,"${item.cartNum}")
    }
}